﻿using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Calico.Client
{
    public class MvcApplication : System.Web.HttpApplication
    {
		/// <summary>
		/// Application Start
		/// </summary>
        protected void Application_Start()
        {
			// Registrations
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

			// Remove the X-AspNetMvc-Version information from header
			MvcHandler.DisableMvcResponseHeader = true;
        }

		/// <summary>
		/// Remove certain headers from server response to minimize security exposure
		/// </summary>
		/// <param name="sender">object</param>
		/// <param name="e">EventArgs</param>
		protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
		{
			// Remove IIS version from header information
			HttpContext.Current.Response.Headers.Remove("Server");
		}
    }
}
